#include "devicedetaildialog.h"
#include "dialoghomenavigation.h"
#include "avtalk.h"

#include <QApplication>
#include <QFile>
#include <QTextStream>

QDialog *maindialog;
TAVTalk *avtalk;

void loadStyleSheet(QString qssName)//
{
    QFile data(qssName);
    QString qssFile;
    if(data.open(QFile::ReadOnly))
    {
        printf("load qss -----------------------\n");
        QTextStream styleIn(&data);
        qssFile = styleIn.readAll();
        data.close();
        qApp->setStyleSheet(qssFile);
    }
    else
    {
        printf("load qss failure -----------------\n");
    }
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    avtalk = new TAVTalk(NULL, NULL, 352, 240);
    avtalk->InitNetwork("192.168.2.55", "S00010101010", "192.168.2.143", "M00010100000");

    printf("argv[0]=%s\n", argv[0]);
    printf("before loadStyleSheet\n");
    loadStyleSheet(QString("/home/TQ210/style-default.qss"));

    //Dialog w;
    //DeviceDetailDialog w;
    DialogHomeNavigation w;
    maindialog = &w;
    w.show();
    return a.exec();
}
